/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pstrres.hpp - String Resource structure definitions.
//
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-2004 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
// String Resources are an optional feature that allows an application to
// dynamically install new string tables and new fonts. This can be used
// to field-upgrade an application with new language support.
//
// This is an advanced feature and is NOT REQUIRED for most systems.
//
// This feature is enabled by defining the PEG_RUNTIME_STRING_RESOURCES
// configuration flag. If this is enabled, PEG_FILE_CLASS and
// PEG_STRING_TABLE must also be defined.
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _RES_FILE_HEADER_
#define _RES_FILE_HEADER_

#if defined(PEG_RUNTIME_RESOURCES)

/*--------------------------------------------------------------------------*/
// Binary Resource header
/*--------------------------------------------------------------------------*/

#define RES_MODULE_TAG    0xbeef        // 
#define RES_FILE_FORMAT_VERSION 0x0200  // 01.00

// binary resource sub-module types:

#define RES_MODTYPE_STABLE  1
#define RES_MODTYPE_SLANG   2
#define RES_MODTYPE_IMAGE   3
#define RES_MODTYPE_FONT    4
#define RES_MODTYPE_COLOR   5
#define RES_MODTYPE_THEME   6

#define RES_NAME_LENGTH   40       // DON'T CHANGE THIS!

struct BinaryResHeader
{
    PEGUSHORT Tag;
    PEGUSHORT FormatVersion;
    PEGUSHORT NumThemes;
    PEGBOOL   HasStringTable;
    PEGUSHORT Crc;
};

struct BinResTheme {
    PEGUSHORT Tag;
    PEGUSHORT Type;
    PEGUSHORT ThemeIndex;
};

struct ResStringTableModHeader {
    PEGUSHORT Tag;
    PEGUSHORT Type;
    PEGUSHORT NumLanguages;
    PEGUSHORT NumStringIds;
    char      UserString[120];
};

struct ResStringLangModHeader {
    PEGUSHORT Tag;
    PEGUSHORT Type;
    char LanguageName[40];
    PEGUSHORT LanguageIndex;
    PEGLONG   StringDataSize;
};

struct ResFontModHeader {
    PEGUSHORT Tag;
    PEGUSHORT Type;
    PEGUSHORT NumPages;
    PEGUINT   FontId;
    PEGUSHORT Zipped;
    char      FontName[RES_NAME_LENGTH];
};

struct ResImageModHeader {
    PEGUSHORT Tag;
    PEGUSHORT Type;
    PEGUSHORT SizeOf;
    PEGUSHORT NumFrames;
    PEGULONG  ImageId;
    PEGBOOL   Zipped;
};

// KGM- the image id should be moved to the frame, it doesn't work otherwise.

struct ResImageFrameHeader {
    PEGUSHORT Tag;
    PEGULONG ZipSize;
    PEGULONG UnzipSize;
};

struct ResColorModHeader {
    PEGUSHORT Tag;
    PEGUSHORT Type;
    PEGUSHORT NumColors;
};




#endif      // PEG_RUNTIME_RESOURCES

#endif      // sentry



